export default {
    mounted(el) {
        console.log(el);
        const oSelector = document.querySelector('.selector')

        const oInput = oSelector.querySelector('input')
        const oPlaceholder = oSelector.querySelector('label')
        const oIcon = oSelector.querySelector('span')

        const oMenu = oSelector.querySelector('.selector-menu')

        oInput.addEventListener('focus', () => {
            oPlaceholder.style.display = 'none'
            oIcon.className = 'iconfont icon-search'
            oMenu.style.display = 'block'

        }, false)

        oInput.addEventListener('blur', () => {
            oIcon.className = 'iconfont icon-arrow-down'
            setTimeout(() => {
                oMenu.style.display = 'none'

                if (oInput.value.length === 0) {
                    oPlaceholder.style.display = 'block'
                }
            }, 200)
        })

    }
}